package nl.zuiderfestival.raydance.view;

import javax.swing.ImageIcon;

public class ImageUtil {


	/** Returns an ImageIcon, or null if the path was invalid. */
	@SuppressWarnings("rawtypes")
	public static ImageIcon createImageIcon(Class clazz, String path) {
	    java.net.URL imgURL = clazz.getResource(path);
	    if (imgURL != null) {
	        return new ImageIcon(imgURL);
	    } else {
	        System.err.println("Couldn't find file: " + path);
	        return null;
	    }
	}
}
